package net.yxsoft.websocket.component;

import io.netty.channel.ChannelHandlerContext;
import io.netty.util.AttributeKey;
import net.yxsoft.model.infrastructure.TsSession;
import rapid.core.Authuser;

import java.util.HashMap;

/**
 * 在这里定义要缓存的KEY
 */
public class AttrKeys {

    private AttrKeys() {
    }

    /**
     * 在线用户列表
     */
    public static final AttributeKey<HashMap<String, Authuser>> ONLINE_USER_MAP = AttributeKey.valueOf("ONLINE_USER_MAP");


    /**
     * 在线会话列表
     */
    public static final AttributeKey<HashMap<String, TsSession>> ONLINE_SESSION_MAP = AttributeKey.valueOf("ONLINE_SESSION_MAP");

    /**
     * 通道对应会话
     */
    public static final AttributeKey<HashMap<ChannelHandlerContext, String>> CHANNEL_SESSION_MAP = AttributeKey.valueOf("CHANNEL_SESSION_MAP");

    /**
     * 会话对应通道
     */
    public static final AttributeKey<HashMap<String, ChannelHandlerContext>> SESSION_CHANNEL_MAP = AttributeKey.valueOf("SESSION_CHANNEL_MAP");

    /**
     * 通道对应用户
     */
    public static final AttributeKey<HashMap<ChannelHandlerContext, String>> CHANNEL_USER_MAP = AttributeKey.valueOf("CHANNEL_USER_MAP");

    /**
     * 用户对应通道
     */
    public static final AttributeKey<HashMap<String, ChannelHandlerContext>> USER_CHANNEL_MAP = AttributeKey.valueOf("USER_CHANNEL_MAP");

    /**
     * 用户ID
     */
    public static final AttributeKey<Integer> UID = AttributeKey.valueOf("UID");
}
